package com.zpl.order.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zpl.entity.BaseEntity;
import com.zpl.order.enums.Brand;
import com.zpl.order.enums.Status;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;


@Data
@TableName("goods")
@ApiModel(value = "货物", description = "货物实体")
public class Goods extends BaseEntity {
//    @ApiModelProperty(value = "主键", required = true)
//    private Long id;
    @ApiModelProperty(value = "类型id", required = true)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField(value = "category_id")
    private Long categoryId;
    @ApiModelProperty(value = "标题", required = true)
    private String title;
    @ApiModelProperty(value = "子标题", required = true)
    @TableField(value = "sub_title")
    private String subtitle;
    @ApiModelProperty(value = "主图", required = true)
    @TableField(value = "main_image")
    private String mainImage;
    @ApiModelProperty(value = "子图", required = true)
    @TableField(value = "sub_images")
    private String subImages;
    @ApiModelProperty(value = "产地", required = true)
    @TableField(value = "original_place")
    private String originalPlace;
    @ApiModelProperty(value = "品牌 0 兰蔻 1纪梵希 2MAC 3YSL 4阿玛尼 5雅诗兰黛 6香奈儿 7迪奥 8SK2 9倩碧 10海蓝之谜 11资生堂 12欧莱雅 13娇兰 14兰芝 .。。。。", required = true)
    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
    private Brand brand;
    @ApiModelProperty(value = "细节描述", required = true)
    private String detail;
    @ApiModelProperty(value = "规格、参数", required = true)
    private String specifications;
    @ApiModelProperty(value = "原价", required = true)
    @TableField(value = "original_price")
    private BigDecimal originalPrice;
    @ApiModelProperty(value = "现价", required = true)
    @TableField(value = "now_price")
    private BigDecimal nowPrice;
    @ApiModelProperty(value = "销量", required = true)
    private int platinum;
    @ApiModelProperty(value = "库存", required = true)
    private int stock;
    @ApiModelProperty(value = "状态：0入库 1上架 2下架 ", required = true)
    @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
    private Status status;
    @ApiModelProperty(value = "最多购买数量", required = true)
    @TableField(value = "max_buy_count")
    private int maxBuyCount;
}
